/*   time:2019-06-13 20:39:49*/
var e = getApp(),
    s = e.requirejs("core");
e.requirejs("foxui"), e.requirejs("jquery"), Page({
    data: {
        express: "",
        expresscom: "",
        expresssn: "",
        orderid: ""
    },
    onLoad: function(r) {
        var t = this;
        s.post("groups.refund", {
            orderid: r.orderid
        }, function(e) {
            0 == e.error ? (e.show = !0, t.setData(e), t.setData({
                options: r
            })) : s.toast(e.message, "loading")
        })
    },
    inputPrickChange: function(e) {
        var s = this.data.express_list,
            r = e.detail.value,
            t = s[r].name,
            a = s[r].express;
        this.setData({
            expresscom: t,
            express: a,
            index: r
        })
    },
    inputChange: function(e) {
        var s = e.detail.value;
        this.setData({
            expresssn: s
        })
    },
    back: function() {
        wx.navigateBack()
    },
    submit: function(e) {
        var r = this,
            t = r.data.expresssn,
            a = (r.data.options.refundid, r.data.options.orderid);
        if ("" != t) {
            var o = {
                express: r.data.express,
                expresscom: r.data.expresscom,
                expresssn: t,
                orderid: a
            };
            s.post("groups.refund.express", o, function(e) {
                0 == e.error ? wx.navigateBack() : wx.showToast({
                    title: e.error,
                    icon: "none",
                    duration: 2e3
                })
            }, !0)
        } else wx.showToast({
            title: "请填写快递单号",
            icon: "none",
            duration: 2e3
        })
    }
});